package netty.InAndOutBundHandler.client;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

/**
 * @ClassName MyClientHandler
 * @Description TODO
 * @Author director吴
 * @Date 2022/4/22 13:33
 * @Version 1.0
 **/
public class MyClientHandler extends SimpleChannelInboundHandler<Long> {



    @Override
    protected void channelRead0(ChannelHandlerContext channelHandlerContext, Long aLong) throws Exception {




    }

    //发送数据
    @Override
    public void channelActive(ChannelHandlerContext ctx) throws Exception {
        System.out.println("MyClientHandler发送数据");

        ctx.writeAndFlush(123456L);//发送 Long类型数据

    }
}
